import Vue from 'vue'
import VueRouter from 'vue-router'
import Reg from '@/views/Reg/Reg.vue'
import Login from '@/views/login/login.vue'
import Main from '@/views/Main/Main.vue'
import home from '@/views/Menus/Home/home.vue'
import UserInfo from '@/views/Menus/User/UserInfo.vue'
import UserAvatar from '@/views/Menus/User/UserAvatar.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/Reg',
    component: Reg
  }, {
    path: '/Login',
    component: Login
  }, {
    path: '/',
    component: Main,
    redirect: '/home',
    children: [
      {
        path: '/home',
        component: home
      }, {
        path: 'user-info',
        component: UserInfo
      },
      {
        path: 'user-avatar',
        component: UserAvatar
      }
    ]

  }
]

const router = new VueRouter({
  routes
})

export default router
